import log from "electron-log/main.js";
import { Config } from "@/common/config";

log.transports.file.resolvePathFn = () => Config.log.logPath;
log.transports.file.format = "{y}-{m}-{d} {h}:{i}:{s}.{ms} [{level}] {text}";

// 设置日志文件大小限制（字节）
log.transports.file.maxSize = Config.log.maxSize;

// 如果需要在控制台也显示日志
log.transports.console.level = "debug";
log.transports.console.format = "{h}:{i}:{s} [{level}] {text}";

log.initialize();

export { log };
